#include<iostream>
using namespace std;
int main ()
{char a[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 
             'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
 char b[52];
 char c[100];
 for(int i=0;i<26;i++)
    cin>>b[i];
 if(b[0]>=97&&b[0]<=122) 
             {  
                   for(int j=26;j<52;j++)
                        b[j]=b[j-26]-32;
             }
 else  if(b[0]>=65&&b[0]<=90){  
             for(int h=26;h<52;h++)
                 b[h]=b[h-26]+32;
                 }
 gets(c);
 int n=strlen(c);
 for(int k=0;k<n;k++)
  { for(int l=0;l<52;l++)
        {
            if(c[k]==b[l])   
              {c[k]=a[l];break;}
        }
        }
             
 cout<<c<<" "<<a<<" "<<b<<endl;
 system("pause");
 return 0;
}
 
 
